<div class="content-wrapper">
    <section class="content-header">
        <h1>文档列表</h1>
        <ol class="breadcrumb">
            <li><a href="/"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li class="active">系统配置</li>
            <li class="active">文档列表</li>
        </ol>
    </section>
    <section class="content">
        <div class="box">
            <div class="box-header with-border">
                <form class="form-inline" action="/admin/document/docList" method="get">
                    <div class="form-group">
                        <label for="name">名称 </label>
                        <input type="text" class="form-control" id="name" name="name" placeholder="文件名称" value="{$name}">
                    </div>
                    <button type="submit" class="btn btn-info" id="save-btn">查询</button>
                </form>
            </div>
            <div class="box-body table-responsive">
                <table class="table table-bordered">
                    <tbody>
                    <tr>
                        <th style="width: 80px">ID</th>
                        <th>名称</th>
                        <th>文档</th>
                    </tr>
                    <if condition="count($docList) eq 0"><tr><td class="text-center" colspan="3">暂无数据...</td></tr></if>
                    <foreach name="docList" item="item">
                        <tr>
                            <td>{$item.id}</td>
                            <td>{$item.name}</td>
                            <td><a href="/admin/index/downloadFile?file={$item.file_path|urlencode}" class="label label-info">下载</a></td>
                        </tr>
                    </foreach>
                    </tbody>
                </table>
            </div>
            <div class="box-footer clearfix">{$page_html}</div>
        </div>
    </section>
</div>
<script src="__PUBLIC__/AdminLTE/plugins/layer/layer.js"></script>
<script>
    $(".btn-delete").click(function () {
        var id = $(this).attr('data-id');
        ArtDialogHlp.showConfirm("提示","确认删除该文档吗？",function () {
            $.post('/admin/document/ajaxDeleteDoc',{
                id: id
            },function (_data) {
                if(_data.Code==999){
                    layer.msg("操作成功",{time:1000});
                    window.location.reload(true);
                }else{
                    layer.msg(_data.Msg,{time:1000});
                    return false;
                }
            },"JSON");
        });
    });
</script>